import { getGenerate } from "@/api/user";
import cookie from "@/utils/store/cookie";

// 通过传入的page路径生成太阳码，并将太阳码存储到缓存中
// page: `pages/Loading/index`
export const generateCode = (page) => {
	return new Promise((resolve, reject) => {
		getGenerate(page).then(res => {
			resolve(res.data)
		}).catch(error => {
			console.log(error);
			reject('获取失败')
		})

	})
}